package com.atguigu.tingshu.album.controller;

import com.atguigu.tingshu.album.service.BaseCategoryService;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.album.BaseCategory1;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * 
 *
 */
@Tag(name = "分类管理")
@RestController
@RequestMapping(value="/admin/album/category")
@SuppressWarnings({"all"})
public class BaseCategoryController {
	
	@Autowired
	private BaseCategoryService baseCategoryService;

	@Operation(summary = "查询所有的一级分类信息")
	@GetMapping("findAllCategory1")
	public Result<List<BaseCategory1>> findAllCategory1() {
		//	获取所有的一级分类数据
		List<BaseCategory1> baseCategory1List = baseCategoryService.findAllCategory1();
		return Result.ok(baseCategory1List);
	}
}

